There is the data: atp_tennis containing the following columns: ['Tournament', 'Date', 'Series', 'Court', 'Surface', 'Round', 'Best of', 'Player_1', 'Player_2', 'Winner', 'Rank_1', 'Rank_2', 'Pts_1', 'Pts_2', 'Odd_1', 'Odd_2', 'score'].  
--- The description for each column this data is:
Tournament: Name of the tennis tournament (Brisbane International, Chennai Open, Qatar Exxon Mobil Open ...etc)
Date: Date the match was played (year-month-day)
Series: Category or level of the tennis tournament (ATP250, ATP500, Masters1000 and Grand Slams offer 250, 500, 1000, and 2000 ranking points to the winner seperately.)
Court: Place the match was held (Indoors or Outdoors)
Surface: Type of court surface (Hard, Grass and Clay)
Round: Stage of the tournament (1st Round, 2nd Round, Quarterfinals, Semifinal and The Final)
Best of: Tourament systems ("best of 3" or "best of 5")
Player_1: Name of the first competitor in each match
Player_2: Name of the second competitor in each match
Winner: Name of the Player_1 or Player_2 who won the match 
Rank_1: World rankings of the Player_1 at the time of the match
Rank_2: World rankings of the Player_2 at the time of the match
Pts_1: Ranking points held by Player_1 before the match (accumulated over the season and higher points typically indicate a more successful player)
Pts_2: Ranking points held by Player_2 before the match
Odd_1: Betting odds for Player_1 (reflecting their perceived chances of winning)
Odd_2: Betting odds for Player_2 
Score: Final score of the match ("score of Player_1" - "score of Player_2")
---
Considering contents from the dataset and requirements from user. Please note DO NOT CHANGE FILE AND VARIABLE NAMES THAT I HAVE SET!
Interactions begin:
[USER (data scientist)]: Hey Tapilot, I'm working on this atp_tennis dataset and I could use a hand. Can you help me figure out if there are any missing values or weird data stuff going on? Please generate a value to show the number of missing values in this dataset.

[YOU (AI assistant)]: No problem, happy to help! Let's start by finding any missing values in the dataset. Here's some code for that :
'''
import pandas as pd
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# Calculate the sum of missing (null) values in each column
missing_values = atp_tennis.isnull().sum()

print(missing_values)

'''

[USER (data scientist)]: Awesome, thanks! Now, I wanna know how many unique values there are for a few columns like Tournament, Series, Court, Surface, and Round. Can you help me out with that? Please generate a Series summarizing the unique value counts for selected columns in this dataset.

[YOU (AI assistant)]: You got it! Here's the code to find the unique values for those columns :
'''
import pandas as pd
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# Calculate the number of unique values for specific columns
# Columns considered are 'Tournament', 'Series', 'Court', 'Surface', 'Round'
unique_values = atp_tennis[['Tournament', 'Series', 'Court', 'Surface', 'Round']].nunique() 

print(unique_values)

'''

[USER (data scientist)]: Sweet! Now, I wanna make a data quality report that shows both the missing values and unique values for each column. Can you help me whip that up? Please generate a dataframe called data quality report showing the number of missing values and unique values in each column of the dataset.

[YOU (AI assistant)]: Absolutely! Let's create a DataFrame to show the data quality report. Here's the code for that :
'''
import pandas as pd
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# Create a DataFrame to store the data quality report, with columns for missing values and unique values
data_quality_report = pd.DataFrame({'Missing Values': missing_values, 'Unique Values': unique_values})    

print(data_quality_report)

'''

[USER (data scientist)]: Hey Tapilot, I'm working with the ATP tennis dataset and could use some help. Can you give me a hand? 

[YOU (AI assistant)]: Absolutely! I'd be happy to help. What do you need assistance with? 

[USER (data scientist)]: To start, I'd like to combine Rank_1, Rank_2, Win_Loss_Ratio_1, and Win_Loss_Ratio_2 into single columns. Please generate a dataframe called combined data report showing the win/loss ratios and ranks of players in this dataset.

[YOU (AI assistant)]: Sure thing! Here's the code to merge those columns :
'''
import pandas as pd
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# Count the number of wins for each player
player_wins = atp_tennis['Winner'].value_counts()
  
# Count the total number of matches played by each player
player_matches = atp_tennis['Player_1'].value_counts() + atp_tennis['Player_2'].value_counts()
  
# Calculate win/loss ratio for each player
win_loss_ratios = player_wins / (player_matches - player_wins)
  
# Add win/loss ratios to the dataset
atp_tennis['Win_Loss_Ratio_1'] = atp_tennis['Player_1'].map(win_loss_ratios)
atp_tennis['Win_Loss_Ratio_2'] = atp_tennis['Player_2'].map(win_loss_ratios)

# Combine Rank_1, Rank_2, Win_Loss_Ratio_1, and Win_Loss_Ratio_2 into single columns   
combined_ranks = pd.concat([atp_tennis['Rank_1'], atp_tennis['Rank_2']]).reset_index(drop=True)   
combined_win_loss_ratios = pd.concat([atp_tennis['Win_Loss_Ratio_1'], atp_tennis['Win_Loss_Ratio_2']]).reset_index(drop=True)   

# Create a DataFrame with combined ranks and win/loss ratios   
combined_data = pd.DataFrame({'Rank': combined_ranks, 'Win_Loss_Ratio': combined_win_loss_ratios})  

print(combined_data)

'''

[USER (data scientist)]: Awesome! Now, can you show me some basic stats for this combined data? Please generate a DataFrame containing descriptive statistics for the ATP tennis dataset.

[YOU (AI assistant)]: You got it! Here's the code to display the descriptive statistics :
'''
import pandas as pd
import numpy as np
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# Calculate and store descriptive statistics for the DataFrame
desc_stats = combined_data.describe()

# Print the descriptive statistics to the console
print(desc_stats)

'''

[USER (data scientist)]: Thanks a bunch! How about a histogram for player rankings distribution? Please generate and display a histogram showing the distribution of player rankings in the ATP tennis dataset.

[YOU (AI assistant)]: No problem! Here's the code to create a histogram using matplotlib :
'''
import pandas as pd
import matplotlib.pyplot as plt 
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# Histogram for Player Rankings Distribution
fig1, ax1 = plt.subplots()
ax1.hist(combined_ranks, bins=50, alpha=0.5)
ax1.set_title('Player Rankings Distribution')
ax1.set_xlabel('Ranking')
plt.savefig('./ref_result/hist_chart.png')
plt.show()
'''

[USER (data scientist)]: That's cool. Now, I'd like to see a scatter plot of player rankings vs win/loss ratios. Please generate and display a scatter plot that compares player rankings with their win/loss ratios in the ATP tennis dataset.

My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

atp_tennis = pd.read_csv('atp_tennis.csv')

# YOUR SOLUTION BEGIN:
<code1>
[COMPLETE YOUR CODE] 
</code1>
# YOUR SOLUTION END

plt.savefig('./pred_result/scatter_chart.png')
plt.show()

---END CODE TEMPLATE---

Please note that you have to generate the WHOLE python code instead of code segments based on the code snippet using Pandas library 2.0.3 version and Matplotlib library 3.7.4 version. You must keep all comments in code snippet unchanged.

[YOU (AI assistant)]: Sure thing! Here's the code to create a scatter plot using matplotlib: 
'''
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

atp_tennis = pd.read_csv('atp_tennis.csv')

# YOUR SOLUTION BEGIN:
